package com.ayou.eggguard.farm.mapper;

import com.ayou.eggguard.farm.pojo.WarningConfig;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface WarningConfigMapper {
    List<WarningConfig> getConfigList(String warningType);

    @Select("select * from warning_config where warning_type=#{warningType}")
    WarningConfig getConfigByName(String warningType);

    @Insert("insert into warning_config(warning_type, warning_description, warning_threshold) " +
            "values(#{warningType},#{warningDescription},#{warningThreshold})")
    void add(WarningConfig warningConfig);
}
